package kr.pe.johnkim.carrotpoint.mobile.service;

import kr.pe.johnkim.carrotpoint.mobile.dao.CarrotPointMerchantStockDao;
import kr.pe.johnkim.carrotpoint.mobile.domain.CarrotPointMerchantStock;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Carrot Point 가맹점(입점업체) 상품 관련 service 클래스 이다.
 *
 * @author : John_Kim <cale9797@gmail.com>
 * @date : 13. 2. 6.
 */
@Service
public class CarrotPointMerchantStockServiceImpl implements CarrotPointMerchantStockService {

    // SLF4J Logging
    private Logger logger = LoggerFactory.getLogger(CarrotPointMerchantStockServiceImpl.class);

    @Autowired
    private CarrotPointMerchantStockDao carrotPointMerchantStockDao;

    /**
     * 가맹점(입점업체) 상품을 등록 한다.
     *
     * @param carrotPointMerchantStock
     */
    @Override
    public void registerMerchantStock(CarrotPointMerchantStock carrotPointMerchantStock) {
        logger.info("registerMerchantStock");
        carrotPointMerchantStockDao.registerMerchantStock(carrotPointMerchantStock);
    }

    /**
     * 가맹점(입점업체) 상품 목록을 가져 온다.
     *
     * @param carrotPointMerchantStock
     * @return
     */
    @Override
    public List<CarrotPointMerchantStock> getMerchantStockList(CarrotPointMerchantStock carrotPointMerchantStock) {
        logger.info("getMerchantStockList");
        return carrotPointMerchantStockDao.getMerchantStockList(carrotPointMerchantStock);
    }

    /**
     * 모든 가맹점(입점업체) 전체 상품 목록을 가져 온다.
     *
     * @param carrotPointMerchantStock
     * @return
     */
    @Override
    public List<CarrotPointMerchantStock> getTotalMerchantStockList(CarrotPointMerchantStock carrotPointMerchantStock) {
        logger.info("getTotalMerchantStockList");
        return carrotPointMerchantStockDao.getTotalMerchantStockList(carrotPointMerchantStock);
    }

    /**
     * 가맹점(입점업체) 상품 내용을 가져 온다.
     *
     * @param carrotPointMerchantStock
     * @return
     */
    @Override
    public CarrotPointMerchantStock getMerchantStockInformation(CarrotPointMerchantStock carrotPointMerchantStock) {
        logger.info("getMerchantStockInformation");
        return carrotPointMerchantStockDao.getMerchantStockInformation(carrotPointMerchantStock);
    }

    /**
     * 가맹점(입점업체) 상품 내용을 수정 한다.
     *
     * @param carrotPointMerchantStock
     */
    @Override
    public void updateMerchantStockInformation(CarrotPointMerchantStock carrotPointMerchantStock) {
        logger.info("updateMerchantStockInformation");
        carrotPointMerchantStockDao.updateMerchantStockInformation(carrotPointMerchantStock);
    }

    /**
     * 가맹점(입점업체) 상품을 비활성화 한다.
     *
     * @param carrotPointMerchantStock
     */
    @Override
    public void updateDeactivateMerchantStock(CarrotPointMerchantStock carrotPointMerchantStock) {
        logger.info("updateDeactivateMerchantStock");
        carrotPointMerchantStockDao.updateDeactivateMerchantStock(carrotPointMerchantStock);
    }

    /**
     * 모든 가맹점(입점업체) 상품 검색 목록을 가져 온다.
     *
     * @param carrotPointMerchantStock
     * @return
     */
    @Override
    public List<CarrotPointMerchantStock> getSearchMerchantStockList(CarrotPointMerchantStock carrotPointMerchantStock) {
        logger.info("getSearchMerchantStockList");
        return carrotPointMerchantStockDao.getSearchMerchantStockList(carrotPointMerchantStock);
    }
}
